<template>
  <demoBlock title="基础用法">
    <vcu-index-bar>
      <template v-for="index in indexLists" :key="index">
        <vcu-index-anchor :index="index" />
        <vcu-cell title="文本" />
        <vcu-cell title="文本" />
        <vcu-cell title="文本" />
      </template>
    </vcu-index-bar>
  </demoBlock>
</template>


<script>
import { defineComponent } from "vue";
const genAlphabet = () => {
  const charCodeOfA = "A".charCodeAt(0);
  const indexList = Array(26)
    .fill("")
    .map((_, i) => String.fromCharCode(charCodeOfA + i));

  return indexList;
};
export default defineComponent({
  setup() {
    const indexLists = genAlphabet();

    return {
      indexLists,
    };
  },
});
</script>